import 'package:flutter/material.dart';
import './index.dart';
import 'mvlist.dart';
import './videos.dart';

class Tabs extends StatefulWidget {
  Tabs({Key? key}) : super(key: key);

  @override
  _TabsState createState() => _TabsState();
}

class _TabsState extends State<Tabs> {
  int _currentIndex = 0;
  var tabs = [Index(), List(), VideoList()];
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // appBar: AppBar(
      //   title: Text('tab'),
      // ),
      // body: tabs[_currentIndex],
      body: IndexedStack(
        index: _currentIndex,
        children: tabs,
      ),

      bottomNavigationBar: BottomNavigationBar(
        onTap: (index) {
          this.setState(() {
            _currentIndex = index;
          });
        },
        currentIndex: _currentIndex,
        // shape: CircularNotchedRectangle(), //圆形缺口
        items: [
          BottomNavigationBarItem(
            icon: Icon(Icons.home),
            label: "主页",
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.list),
            label: "短视频",
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.person),
            label: "我的",
          ),
        ],
      ),
    );
  }
}
